package com.clps.learning.service.impl;

import com.clps.learning.pojo.Admin;
import com.clps.learning.pojo.BaseUser;
import com.clps.learning.pojo.Customer;
import com.clps.learning.service.SignUpService;
import com.clps.learning.utils.FileUtil;
import com.clps.learning.utils.RoleUtil;

/**
 * @Program: clps-learning
 * @Description:
 * @author: Cooper
 * @date: 2021.10.12
 * @Version: 1.0
 */
public class SignUpServiceImpl implements SignUpService {


    @Override
    public Boolean signUp(String username, String password, Integer role) {
        if(role==1){
            // 新建Admin对象
            return FileUtil.write(new Admin(username, password));
        }else if(role==0){
            // 新建Customer对象
            return FileUtil.write(new Customer(username, password));
        }
        return false;
    }

}
